package com.echoesnet.echoesshortvideo.Activities;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.baidu.mobstat.StatService;
import com.echoesnet.echoesshortvideo.Utils.CommonUtils;

import java.util.Arrays;
import java.util.List;

public class BaseActivity extends FragmentActivity
{
    //不做统计的页面列表
    private List<String> notStatPages =
            Arrays.asList(new String[]{"MainAct"});

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        CommonUtils.setTransparentTopBar(this);
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        // baidu统计
        if (!notStatPages.contains(this.getClass().getSimpleName()))
        {
            StatService.onResume(this);
        }
    }

    @Override
    protected void onPause()
    {
        super.onPause();
        if (!notStatPages.contains(this.getClass().getSimpleName()))
        {
            StatService.onPause(this);
        }
    }
}
